#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>


#define PIECE_SIZE 2048


/*********************************** Structures ******************************************/

//#define MAX_FILENAME 30
typedef struct buffermap{
	char * buffer;
	long long size;
}buffermap;


/********************************** Static functions ***************************************/

void conversion_binaire(long long val, char * buffer, int buffer_size);

buffermap create_buffermap(long long decimal, unsigned int file_size); 

void init_buffermap(buffermap bm, char * filename);

void destroy_buffermap(buffermap* buffer);

void MAJ__buffermap(buffermap bm, int piece_number);

void print_buffermap(buffermap bm);

long long buffmap_to_int(buffermap bm);
